import request from '@/utils/request'

// ==================== 社团信息管理相关API ====================

// 获取社团详细信息
export function getClub(clubId) {
  return request({
    url: '/campus/club/' + clubId,
    method: 'get'
  })
}

// 修改社团信息
export function updateClub(data) {
  return request({
    url: '/campus/club',
    method: 'put',
    data: data
  })
}

// 获取社团统计信息
export function getClubStatistics(clubId) {
  return request({
    url: '/campus/club/stats',
    method: 'get'
  })
}

// 获取当前登录用户的社团上下文（clubId）
export function getMyClubContext() {
  return request({
    url: '/campus/club/context/my',
    method: 'get'
  })
}

// 获取热门社团
export function getPopularClubs() {
  return request({
    url: '/campus/club/popular',
    method: 'get'
  })
}

// 按类型查询社团
export function getClubsByType(clubType) {
  return request({
    url: '/campus/club/type/' + clubType,
    method: 'get'
  })
}
